fonteditor-core
FontEditor core functions
Feature
- sfnt parse
- read, write, transform fonts (ttf, woff, eot, svg, otf)
- ttf glyph adjust
- svg to glyph
Usage
var Font = require('fonteditor-core').Font;
var fs = require('fs');
var buffer = fs.readFileSync('font.ttf');
var font = Font.create(buffer, {
type: 'ttf',
subset: [65, 66],
hinting: true,
compound2simple: true,
inflate: null,
combinePath: false,
});
var fontObject = font.get();
console.log(Object.keys(fontObject));
var buffer = font.write({
type: 'woff',
hinting: true,
deflate: null,
});
font.toBase64({
type: 'ttf'
});
font.optimize()
font.compound2simple()
font.sort()
var result = font.find({
unicode: [65]
});
var result = font.find({
filter: function (glyf) {
return glyf.name == 'icon'
}
});
font.merge(font1, {
scale: 1
});
Demo
edp webserver
open http://127.0.0.1:9999/demo
Related
License
MIT © Fonteditor